package com.cecsmsserve.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cecsmsserve.entity.DiningReview;
import com.cecsmsserve.mapper.DiningReviewMapper;
import com.cecsmsserve.service.DiningReviewService;
import org.springframework.stereotype.Service;

@Service
public class DiningReviewServiceImpl extends ServiceImpl<DiningReviewMapper, DiningReview> implements DiningReviewService {
    @Override
    public boolean submitReview(DiningReview review) {
        return save(review);
    }

    @Override
    public DiningReview getReviewByOrderId(Integer orderId) {
        QueryWrapper<DiningReview> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("order_id", orderId);
        return getOne(queryWrapper);
    }
} 